
uniform float isPortrait;
uniform vec2 bounds;

void mainImage( out vec4 fragColor, in vec2 fragCoord )
{
    vec2 textureCoordinate = fragCoord.xy / iResolution.xy;
    vec2 uv = isPortrait > 0.5 ? textureCoordinate : vec2(textureCoordinate.y, textureCoordinate.x);
    
    if(uv.y > bounds.x && uv.y < bounds.y) {
        float tick = iGlobalTime;
        uv.x += step(0.3, sin(tick + 4.0 * cos(tick * 4.0))) < 0.5
        ? 0.0 : sin(uv.y * 10.0 + tick)
        * (1.0 + cos(tick * 80.0))
        * 0.005 * (isPortrait > 0.5 ? 1.0 : 0.5625);
    }
    fragColor = texture2D(iChannel0, isPortrait > 0.5 ? uv : vec2(uv.y, uv.x));
}


